;(function(win){
	win.Browser = {};
	var ua = navigator.userAgent.toLowerCase();
  var UA = ua.match(/(opera|ie|firefox|chrome|trident|crios|version)[\s\/:]([\w\d\.]+)?.*?(safari|(?:rv[\s\/:]|version[\s\/:])([\w\d\.]+)|$)/) || [null, 'unknown', 0];
  if (UA[1] == 'trident'){
      UA[1] = 'ie';
      if (UA[4]) UA[2] = UA[4];
  } else if (UA[1] == 'crios'){
      UA[1] = 'chrome';
  }
  var platform ;
  if(ua.match(/ip(?:ad|od|hone)/)){
    platform = 'ios';
  }else if(platform = ua.match(/(?:webos|android)/)){
    platform = platform[0];
  }else if(platform = ua.match(/mac|win|linux/)){
    platform = platform[0];
  }else{
    platform = 'other';
  }
  if (platform == 'win') platform = 'windows';

  var app = /micromessenger/.test(ua) ? 'wechat' : ( /qq/.test(ua) ? 'qq' : (/weibo/.test(ua) ? 'weibo' : (/com\.xisue\.zhoumo/.test(ua) ? 'xisue' : '')));

  Browser.name = (UA[1] == 'version') ? UA[3] : UA[1];
  Browser.version =  parseFloat((UA[1] == 'opera' && UA[4]) ? UA[4] : UA[2]);
  Browser.platform = platform;
  Browser.app = app;

  Browser.name = (UA[1] == 'version') ? UA[3] : UA[1];
	Browser.version =  parseFloat((UA[1] == 'opera' && UA[4]) ? UA[4] : UA[2]);
	Browser.platform = platform;
	Browser.app = app;
  
  try{
    if(app == 'xisue'){
      var appVersion = ua.match(/com\.xisue\.zhoumo(?:\.devel)?\/(\d)\.(\d)(?:\.(\d))?/);
      if(appVersion){
        Browser.appv_1 = appVersion[1] || null;
        Browser.appv_2 = appVersion[2] || null;
        Browser.appv_3 = appVersion[3] || null;
      }
    }
  }catch(err){
    console.log('xisue ua 正则式需调整');
  }

	var styles = window.getComputedStyle(document.documentElement, '');
  var stylesStr = '';
  try{
    stylesStr = Array.prototype.slice.call(styles).join('');
  }catch(error){
    // 锤子手机浏览 iligal access
    for(var i = 0,l = styles.length; i < l; i++){
      stylesStr += styles[i];
    }
  }
  
  var pre = (stylesStr.match(/-(moz|webkit|ms)-/) || (styles.OLink === '' && ['', 'o']))[1];
  
  Browser.cssPrefix = '-' + pre + '-';
  Browser.transform = pre[0].toUpperCase() + pre.substr(1) + 'Transform';

  var el = document.createElement('div');
  var transEndEventNames = {
    WebkitTransition : 'webkitTransitionEnd',
    MozTransition : 'transitionend',
    OTransition : 'oTransitionEnd otransitionend',
    transition : 'transitionend'
  };

  for (var name in transEndEventNames) {
    if (el.style[name] !== undefined) {
      Browser.transEndName = transEndEventNames[name];
      break;
    }
  }

                
})(window)
